package com.qanda.data.entities;

import java.io.Serializable;
import java.util.Vector;

public class AnketaPitanje extends ComparableEntity implements Serializable{

	private int idTema;
	private int rbr;
	private String tip;
	private String naslov;
	
	private Vector<StavkaPitanje> stavke;
	

	public AnketaPitanje(int idTema, int rbr, String tip, String naslov,
			Vector<StavkaPitanje> stavke) {
		super();
		this.idTema = idTema;
		this.rbr = rbr;
		this.tip = tip;
		this.naslov = naslov;
		this.setStavke(stavke);
	}

	public AnketaPitanje()
	{
		super();
		stavke=new Vector<StavkaPitanje>();
	}
	
	public int getIdTema() {
		return idTema;
	}

	public void setIdTema(int idTema) {
		this.idTema = idTema;
	}

	public int getRbr() {
		return rbr;
	}

	public void setRbr(int rbr) {
		this.rbr = rbr;
	}

	public String getTip() {
		return tip;
	}

	public void setTip(String tip) {
		this.tip = tip;
	}

	public String getNaslov() {
		return naslov;
	}

	public void setNaslov(String naslov) {
		this.naslov = naslov;
	}

	@Override
	public int compareTo(ComparableEntity another) {
		if(this.rbr>((AnketaPitanje)another).rbr)return 1;
		else if(this.rbr == ((AnketaPitanje)another).rbr)return 0;
		else return -1;
	}

	public void setStavke(Vector<StavkaPitanje> stavke) {
		this.stavke = stavke;
	}

	public Vector<StavkaPitanje> getStavke() {
		return stavke;
	}

}
